<%@ page import="TeachLesson.SolveProEnity" %>
<%@ page import="TeachLesson.SolveProDao" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/23
  Time: 11:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>答疑列表</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link href="/SystemerNav/SystemerNav.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-CCTZv2q9I9m3UOxRLaJneXrrqKwUNOzZ6NGEUMwHtShDJ+nCoiXJCAgi05KfkLGY" crossorigin="anonymous">
</head>
<%
    String workerNo=(String) session.getAttribute("workerNo");
    String courseNo=(String) session.getAttribute("courseNo");
    request.setCharacterEncoding("UTF-8");
    response.setContentType("text/html;charset=UTF-8");
    out.println(workerNo);
%>
<body background="/LoginInterface/loginFace.jpg">
<div class="container">
    <div class="top">
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="courseMangement.jsp?workerNo=<%=workerNo%>&courseNo=<%=courseNo%>">首页</a> </li>
                <li><a href="/TeacherServlet/seletIntroduceServlet?workerNo=<%=workerNo%>&courseNo=<%=courseNo%>">课程简介</a> </li>
                <li><a href="AddStudentLesson.jsp">添加学生</a> </li>
                <li><a href="unitStudy.jsp?workerNo=<%=workerNo%>&courseNo=<%=courseNo%>">单元学习</a></li>
                <li><a href="courseWorkMangement.jsp?workerNo=<%=workerNo%>&courseNo=<%=courseNo%>">作业管理</a> </li>
                <li><a href="SolvePro.jsp?workerNo=<%=workerNo%>&courseNo=<%=courseNo%>">答疑讨论</a> </li>
            </ul>
        </div>


    <form action="/TeachLesson/addSolveProServlet" method="post" >
        <div class="row">
            <div class="col-xs-5">
                <input type="text" class="form-control" placeholder="答疑讨论标题" name="title">
                <input type="hidden" name="workerNo" value="<%=workerNo%>">
                <input type="hidden" name="courseNo" value="<%=courseNo%>">
            </div>
        </div>
        <textarea class="form-control" rows="5" placeholder="请输入正文" name="realText"></textarea>
        <button type="submit" class="btn btn-primary">发布</button>
    </form>
    </div>

    <div class="bottom">
        <table class="table table-condensed">
            <tr>
                <td>标题</td>
                <td>删除</td>
            </tr>
            <%
                SolveProDao solveProDao=new SolveProDao();
                ArrayList<SolveProEnity> list=solveProDao.selectAllPro();
                if(list!=null){
                    for (SolveProEnity temp:list){
                        %>
            <tr>
                <td><a target="_blank" href="SolveText.jsp?titleID=<%=temp.getTitleId()%>&title=<%=temp.getTitle()%>&realText=<%=temp.getRealText()%>"><%=temp.getTitle()%></a> </td>
                <td><a href="/TeachLesson/deleteSolveProServlet?titleID=<%=temp.getTitleId()%>" >删除</a> </td>
            </tr>
            <%
                    }
                }%>
        </table>
    </div>
</div>
</body>
</html>
